package cxf.client;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

public class CxfClientTest {
    public static void main(String[] args) throws Exception{
        JaxWsDynamicClientFactory clientFactory =
                JaxWsDynamicClientFactory.newInstance();
//        Client client = clientFactory.createClient("http://127.0.0.1:9999/cxf?wsdl");
        Client client = clientFactory.createClient("http://127.0.0.1:8080/services/cxf?wsdl");
        //直接调用方法，不用关心服务端是怎么实现的
//        Object[] result = client.invoke("sayHello");
//        for (Object o : result) {
//            System.out.println(o);
//        }

        Object[] result2 = client.invoke("sayHelloWorld", "123");
        System.out.println(result2[0]);

    }
}
